#!/usr/bin/node

const log = console.log,
      fs = require('fs'),
      filename = process.argv[2] || __filename;

if(!fs.existsSync(filename)){
  log(`${filename} not exists!`);
  process.exit(1);
}

if(fs.statSync(filename).isDirectory()){
  log(`${filename} is a directory`);
  process.exit(2);
}

if(!(fs.statSync(filename).isFile())){
  log(`${filename} is not a file`);
  process.exit(3);
}

fs.createReadStream(filename).pipe(process.stdout)
